package com.icedevcloud.upms.api.user;

import com.icedevcloud.common.core.api.R;
import com.icedevcloud.upms.api.user.dto.QueryUserResDto;
import com.icedevcloud.upms.service.ISysUserService;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * 用户远程调用 SysUserRemote
 *
 * @author dengbing
 * @since 2023-09-10
 */
@AllArgsConstructor
@RequestMapping("/provider/sysUser")
@RestController
public class SysUserProvider implements ISysUserProvider {

    private final ISysUserService iSysUserService;

    @Override
    public R<QueryUserResDto> queryUserByUsername(@RequestParam(name = "username") String username) {
        QueryUserResDto resDto = iSysUserService.queryUserByUsername(username);
        return R.ok(resDto);
    }

}
